from flask_restful import fields  # type: ignore

from libs.helper import TimestampField

transfee_fields = {
    "id": fields.String,
    "transport_id": fields.String,
    "continuous_piece": fields.Float,
    "first_piece": fields.Float,
    "continuous_fee": fields.Integer,
    "ContinuousFee": fields.Float,
    "first_fee": fields.Integer,
    "FirstFee": fields.Float,
    "city_list": fields.List(fields.String),
}

transfee_free_fields = {
    "id": fields.String,
    "transport_id": fields.String,
    "free_type": fields.String,
    "amount": fields.Integer,
    "Amount": fields.Float,
    "piece": fields.Float,
    "city_list": fields.List(fields.String),
}

transport_fields={
    "id":fields.String,
    "name":fields.String,
    "shop_id":fields.String,
    "charge_type":fields.String,
    "is_free_fee":fields.Boolean,
    "has_free_condition":fields.Boolean,
    "transfees":fields.List(fields.Nested(transfee_fields)),
    "transfee_frees":fields.List(fields.Nested(transfee_free_fields)),
    "created_at":TimestampField,
    "created_by":fields.String,
    "updated_at":TimestampField,
    "updated_by":fields.String,
}

transport_list_fields={
    "total":fields.Integer,
    "has_more":fields.Boolean,
    "data":fields.List(fields.Nested(transport_fields)),
    "message":fields.String,
}